﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IICQBot;
using System.Threading;

namespace Test_IICQBot
{
    class Console_test_IICQBot
    {
        private static IICQBot.ICQBot _bot;

        static void Main(string[] args)
        {
            //Тестовый экземпляр бота     
            _bot = new ICQBot();
            _bot.OnAddedLog += new EventHandler<EventTools.EventArgs<string>>(_bot_OnAddedLog);
            _bot.OnSendedMsg += new EventHandler<EventTools.EventArgs<string, string>>(_bot_OnSendedMsg);
            _bot.ConnectOnICQServer("619300201","1q@W3e");

            while (true)
            {
                Thread.Sleep(1000);
            }
        }

        static void _bot_OnSendedMsg(object sender, EventTools.EventArgs<string, string> e)
        {
            _bot.SendMessage(e.Value,e.Value2);
        }

        static void _bot_OnAddedLog(object sender, EventTools.EventArgs<string> e)
        {
            Console.WriteLine(e.Value);
        }
    }
}
